/**
 * Captain
 * © 2017 Captain copyright，All rights reserved.
 * http://www.sccaptain.com.cn
 * 
 * JAVA : 8
 * 文  件  名: ApplicationContextUtil.java
 * 创  建  人: sunfeng (sun.feng@sccaptain.com.cn)
 * 创建时间: 2017年8月30日 上午9:38:31
 * 版         本: 1.0.0
 * 备         注:
 * 修订历史:
 */
package com.material.c2c.util;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

/**
 * 获取spring容器的工具类
 * 
 * @since 1.0
 * @version 1.0
 * @author sunfeng (sun.feng@sccaptain.com.cn)
 */
public class ApplicationContextUtil implements ApplicationContextAware {

  private static ApplicationContext applicationContext;

  @Override
  public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
    ApplicationContextUtil.applicationContext = applicationContext;
  }

  public static ApplicationContext getApplicationContext() {
    return ApplicationContextUtil.applicationContext;
  }

}
